<template>
  <div class="box" id="scroll-container">
<!--    {{JSON.stringify(screenSize)}}-->
    <mibileEnd v-if="screenSize.width < typeScreen"></mibileEnd>
    <pc ref="pc" v-else></pc>
  </div>
</template>
<script>
import { mapGetters } from "vuex";
import pc from "./components/pc.vue";
import mibileEnd from "./components/mobileEnd.vue";
export default {
  name: "Community",
  components: {
    pc,
    mibileEnd,
  },

  data() {
    return {};
  },
  computed: {
    ...mapGetters(["screenSize","typeScreen"]),
  },
  watch:{
    screenSize:function (val,oldVal){
      if(val.width<this.typeScreen){
        // location.reload();
      }else{

      }
    }
  }

  ,
  methods: {
    checkScroll() {
      this.$refs.pc.checkScroll();
    },
    loadMoreData() {
      // 在这里实现你的加载更多数据的逻辑
      console.log("到底了");
    },
  },
};
</script>
<style lang="scss" scoped>
.box {
  height: calc(100vh - 100px);
  width: 100%;
  background-color: #f1f3f8;
  /* overflow-y: auto; */
}
</style>
